function deepClone(obj) {
    let cloneObj;
    if (obj && typeof obj !== 'object') {
        // 基本数据类型，直接返回
        cloneObj = obj;
    } else if (obj && typeof obj === 'object') {
        // 数组或对象时，进行深入；
        cloneObj = Array.isArray(obj) ? [] : {};
        for (let key in obj) {
            if (obj.hasOwnProperty(key)) {
                cloneObj[key] = deepClone(obj[key]);
            }
        }
    }
    return cloneObj;
}

let per = [{ name: 'tom' }, { name: 'jack' }, { tan: 'ke' }];
let res = deepClone(per);
console.log(res);
res[1].name = 'kate';
console.log(res, per);
